<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>牧心农业</title>
    <link rel="stylesheet" type="text/css" href="/static/css/eui.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/mobile.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/iconfont.css" />
    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/swipe.js"></script>
    <script src="/static/js/doT.min.js"></script>
    <script src="/static/js/func.js"></script>
</head>
<body>
    <div class="content margin_top">
        <header class="header fixed_top bg_mx_green"></header>
        <div class="swipe">
            <div class='swipe-wrap'></div>
            <ul class="position"></ul>
        </div>
        <div class="detail light"></div>
    </div>
    <script type="text/template" charset="utf-8" id='swipe_template'></script>
    <script type="text/template" charset="utf-8" id='detail_template'>
        <div class="bg_white margin_b_10">
            <div class="row border_b padding_10_15">
                <div class="col_5">{{=it.type}}</div>
                <div class="col_7">编号:{{=it.no}}</div>
            </div>
            <div class="row padding_10_15">
                <div class="col_6">代养农户：{{=it.operator}}</div>
                <div class="col_6 warning">状态：{{=it.status}}</div>
                <div class="col_12">地址：{{=it.address}}</div>
            </div>
        </div>
        <div class="bg_white lineheight_4">
            <div class="arrow_down padding_h_15 border_b from_nav">档案</div>
            <div class="padding_15 font_12 row hide">
                <div class="pull_left padding_r_10">猪场合同编号：{{=it.contract_no}}</div>
                <div class="pull_left padding_r_10">猪场：{{=it.slaughterhouse}}</div>
                <div class="pull_left">批次：{{=it.no}}</div>
                <div class="pull_left flex_row_2">
                    <div class="row_one">
                        <div class="">父本编号:{{=it.f_no}}</div>
                        <img src="{{=it.f_img}}" alt="">
                    </div>
                    <div class="row_one">
                        <div class="">母本编号:{{=it.m_no}}</div>
                        <img src="{{=it.m_img}}" alt="">
                    </div>
                </div>
            </div>
            <div class="arrow_down padding_h_15 border_b from_nav">生长环境</div>
            <div class="padding_15 flex_row_4" style="display:none">
                {{for(var i=0;i<it.surroundings.length;i++){}}
                <div class="row_one surrounding_img"><img src="{{=it.surroundings[i]}}" alt="" height="100%"></div>
                {{}}}
            </div>
            <div class="arrow_down padding_h_15 border_b from_nav">巡检记录</div>
            <div class="padding_15 font_12 light hide">
                {{for(var i=0;i<it.records.length;i++){}}
                <div class="h_justify" onclick="location.href='{{=it.records[i].url}}'">
                    <div>{{=it.records[i].title}}</div>
                    <div>第{{=it.records[i].no}}次常规巡检</div>
                    <div>巡检人：{{=it.records[i].who}}</div>
                </div>
                {{}}}
            </div>
            <div class="arrow_down padding_h_15 border_b from_nav">品种介绍</div>
            <div class="hide padding_10_15 text_indent lineheight_2">{{=it.typeinfo}}</div>
            <!--<div class="arrow_down padding_h_15 from_nav">品质说明</div>-->
            <!--<div class="hide padding_10_15 text_indent lineheight_2">{{=it.enviroment}}</div>-->
        </div>
    </script>
    <script>
        // 轮播模版
            //var banner = ["/static/images/from.jpg","/static/images/pig1.jpg","/static/images/pig2.jpg"]
            var banner  = <{$banner}>;
            loadswipe(banner)
        // 详情模版
            //var detail = {id:"1",type:"牧心一号农业生态猪",number:"柞A20160713245123",operator:"张在行",status:"成长中",contract_no:"1431251351",slaughterhouse:"三元土猪场",no:"No1253",address:"陕西省商洛市柞水县盘龙镇张家村二组3号",f_no:"546411323455",f_img:"/static/images/from_f.jpg",m_no:"546411323315",m_img:"/static/images/from_m.jpg",surroundings:["/static/images/farmer_img.jpg","/static/images/list1.jpg","/static/images/list2.jpg","/static/images/pig.jpg","/static/images/farmer_img.jpg","/static/images/list1.jpg","/static/images/list2.jpg","/static/images/pig.jpg"],records:[{title:"巡检标题(2017-06-11)",no:"4",who:"王小二"},{title:"巡检标题(2017-05-25)",no:"3",who:"王小二"},{title:"巡检标题(2017-05-18)",no:"2",who:"王小二"},{title:"巡检标题(2017-05-12)",no:"1",who:"王小二"}],typeinfo:"牧心农业采用最原始的生态养猪法，从猪肉的最源头保证猪肉品质。每一个环节都科学管理，每一头猪都生态饲养。不论口感还是营养价值，都是我们不断追求的目标。",enviroment:"盘龙小院位于柞水溶洞山下，周边环境优美，开门见山，空气清新。我们家有五间房子，房间设施整洁干净，有完整的卫浴设备。欢迎大家来我家游玩。"};
            var detail = <{$detail}>;
            var evaldetail = doT.template($("#detail_template").text());
            loaddata(".detail",evaldetail,detail)
            $(".surrounding_img").css("height",(($(window).width()-45)*0.7/4)+"px")
        // 详情项打开关闭特效
            $(".from_nav").click(function(){
                $(this).toggleClass("arrow_down arrow_up").next().toggle()
            })
        // 页面初始化：头部
            loadheadbar("我的仔猪详情")
    </script>
</body>
</html>
